<%= form_for(@transaction) do |f| %>
  <% if @transaction.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@transaction.errors.count, "error") %> prohibited this transaction from being saved:</h2>

      <ul>
      <% @transaction.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :amount %>
    <%= f.text_field :amount, :size=>"7" %>
  </div>
  <div class="field">
    <%= f.text_field :on_date,:class =>"date",:size =>8 %>
  </div>
  <%= f.hidden_field :is_credit, :value => @transaction.person.customer?? true:false %>
  <%= f.hidden_field :person_id, :value => @transaction.person.id %>
  <div class="actions">
    <%= f.submit @transaction.person.customer?? "Recieve":"Pay" %>
  </div>
<% end %>
